<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateEventTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateEventLabel_eventID}" for="eventID" />
                    <h:inputText id="eventID" value="#{eventController.selected.eventID}" title="#{bundle.CreateEventTitle_eventID}" required="true" requiredMessage="#{bundle.CreateEventRequiredMessage_eventID}"/>
                    <h:outputLabel value="#{bundle.CreateEventLabel_topic}" for="topic" />
                    <h:inputText id="topic" value="#{eventController.selected.topic}" title="#{bundle.CreateEventTitle_topic}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_createDate}" for="createDate" />
                    <h:inputText id="createDate" value="#{eventController.selected.createDate}" title="#{bundle.CreateEventTitle_createDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_startDate}" for="startDate" />
                    <h:inputText id="startDate" value="#{eventController.selected.startDate}" title="#{bundle.CreateEventTitle_startDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_endDate}" for="endDate" />
                    <h:inputText id="endDate" value="#{eventController.selected.endDate}" title="#{bundle.CreateEventTitle_endDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateEventLabel_located}" for="located" />
                    <h:inputText id="located" value="#{eventController.selected.located}" title="#{bundle.CreateEventTitle_located}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_maxNoOfParticipants}" for="maxNoOfParticipants" />
                    <h:inputText id="maxNoOfParticipants" value="#{eventController.selected.maxNoOfParticipants}" title="#{bundle.CreateEventTitle_maxNoOfParticipants}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_curNoOfParticipants}" for="curNoOfParticipants" />
                    <h:inputText id="curNoOfParticipants" value="#{eventController.selected.curNoOfParticipants}" title="#{bundle.CreateEventTitle_curNoOfParticipants}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_fee}" for="fee" />
                    <h:inputText id="fee" value="#{eventController.selected.fee}" title="#{bundle.CreateEventTitle_fee}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_imageurl}" for="imageurl" />
                    <h:inputText id="imageurl" value="#{eventController.selected.imageurl}" title="#{bundle.CreateEventTitle_imageurl}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_details}" for="details" />
                    <h:inputTextarea rows="4" cols="30" id="details" value="#{eventController.selected.details}" title="#{bundle.CreateEventTitle_details}" />
                    <h:outputLabel value="#{bundle.CreateEventLabel_speakerID}" for="speakerID" />
                    <h:selectOneMenu id="speakerID" value="#{eventController.selected.speakerID}" title="#{bundle.CreateEventTitle_speakerID}" >
                        <f:selectItems value="#{speakerController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateEventLabel_createPerID}" for="createPerID" />
                    <h:selectOneMenu id="createPerID" value="#{eventController.selected.createPerID}" title="#{bundle.CreateEventTitle_createPerID}" >
                        <f:selectItems value="#{personController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateEventLabel_categoryID}" for="categoryID" />
                    <h:selectOneMenu id="categoryID" value="#{eventController.selected.categoryID}" title="#{bundle.CreateEventTitle_categoryID}" >
                        <f:selectItems value="#{categoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{eventController.create}" value="#{bundle.CreateEventSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{eventController.prepareList}" value="#{bundle.CreateEventShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateEventIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
